package jianzhiOffer;

public class Num56_1 {
    public int[] singleNumbers(int[] nums) {
        int a = 0,b = 0;
        int m = 1;
        int num = 0;
        for(int i : nums) {
            num = num ^ i;
        }
        while((num & m)== 0)
            m = m << 1;
        for(int i : nums) {
            if((i & m) == 0) {
                a = a ^ i;
            }else {
                b = b ^ i;
            }
        }
        int[] arr = new int[]{a,b};
        return arr;
    }
}
